const express = require('express')

const StaticRouter = express.Router()


/* 路由首位 */

StaticRouter.get('/', (req, res) => {
    if (req.query.ha == 'exit') {
        req.session.registerStatus = 0
        res.redirect('/')
    } else {
        if (req.session.registerStatus == 1) {
            res.render('home')
        } else {
            res.redirect('/login')
        }
    }
})

StaticRouter.get('/login', (req, res) => {
    res.render('login')
})

StaticRouter.get('/register', (req, res) => {
    res.render('register')
})


module.exports = StaticRouter